package com.xiaochong.tir.apiservice.service;

import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;
import com.xiaochong.tir.common.data.po.CurrencyInfoHbase;
import com.xiaochong.tir.common.data.mapper.CurrencyInfoHbaseMapper;

/**
 * 此类为[基础代码]自动生成,已经拥有基本的增删改成操作 
 * <其他请自行扩展>
 * @author cx
 * @time 2018-04-26 10:20
 * 
 */
@Service
public class CurrencyInfoHbaseService{
 
      
    @Autowired
	private CurrencyInfoHbaseMapper currencyInfoHbaseDao;
	
	
	/**
     * 新增
     * @param entity 
     * @param session
     */
    public int insertSelective (CurrencyInfoHbase entity) { 
     return this.currencyInfoHbaseDao.insertSelective(entity);
    }	
    
    /**
     * 批量新增
     * @param list 
     * @param session
     */
    public void insertBatch(List<CurrencyInfoHbase> list) {
           
          this.currencyInfoHbaseDao.insertBatch(list);
         
         
    }

    /**
     * 根据主键修改单条数据
     * @param entity 
     * @param session
     */
    public int updateByPrimaryKey(CurrencyInfoHbase entity) {
           return this.currencyInfoHbaseDao.updateByPrimaryKey(entity);
    }
    
    /**
     * 根据主键批量修改数据
     * @param list 
     * @param session
     */
    public void updateBatch(List<CurrencyInfoHbase> list) {
           
          this.currencyInfoHbaseDao.updateBatch(list);
          
        
    }
    
    /**
     * 根据主键查询单条数据
     * @param id
     */
    public CurrencyInfoHbase selectByPrimaryKey(Integer id) {
            return this.currencyInfoHbaseDao.selectByPrimaryKey(id);
    }
    
    /**
     * 根据条件查询单条记录
     * @param entity 
     */
    public CurrencyInfoHbase selectByEntity(CurrencyInfoHbase entity) {
           return this.currencyInfoHbaseDao.selectByEntity(entity);
    }
    
    
    /**
     * 根据条件查询多条记录
     * @param entity 
     */
    public List<CurrencyInfoHbase> selectByEntityList(CurrencyInfoHbase entity) {
           return  this.currencyInfoHbaseDao.selectByEntityList(entity);
    }
    
    /**
     * 根据条件查询Id
     * @param entity 
     */
    public Integer selectById(CurrencyInfoHbase entity) {
           return  this.currencyInfoHbaseDao.selectById(entity);
    }
    
     /**
     * 根据条件查询Ids
     * @param entity 
     */
    public List<Integer> selectByIds(CurrencyInfoHbase entity) {
        return  this.currencyInfoHbaseDao.selectByIds(entity);
    }
    
     /**
     * 根据主键删除单条记录
     * @param id
     */
    public void deleteByPrimaryKey(Integer id) {
           this.currencyInfoHbaseDao.deleteByPrimaryKey(id);
    }
    
    /**
     * 根据主键删除多条记录
     * @param list
     */
    public void deleteBatch(List<Integer> list) {
           this.currencyInfoHbaseDao.deleteBatch(list);
    }
    
     /**
     * 根据某些条件删除
     * @param entity
     */
    public void deleteBatch(CurrencyInfoHbase entity) {
           this.currencyInfoHbaseDao.deleteByEntity(entity);
    }


    public Date selectMaxMinCreateTime(String asc) {
        return this.currencyInfoHbaseDao.selectMaxMinCreateTime(asc);
    }

    public Date todayCreateTime(String asc) {
        return this.currencyInfoHbaseDao.todayCreateTime(asc);
    }

    public int todayCreateTimeCount() {
        return this.currencyInfoHbaseDao.todayCreateTimeCount();
    }

    public List<Date> listMaxMinCreateTime(String asc) {
        return this.currencyInfoHbaseDao.listMaxMinCreateTime(asc);
    }

    public List<CurrencyInfoHbase> listAfterCreateTime(String cmcId, Date date) {
        return this.currencyInfoHbaseDao.listAfterCreateTime(cmcId,date);
    }

    public List<CurrencyInfoHbase> selectByCmcIdYmdh(String cmcId, String date) {
        return this.currencyInfoHbaseDao.selectByCmcIdYmdh(cmcId,date);
    }

    public Date selectAfterNearDate(String date) {
        return this.currencyInfoHbaseDao.selectAfterNearDate(date);
    }
}